<?php
namespace Acme\BlogBundle\Entity;

use Symfony\Component\Validator\Constraints\NotBlank;

use Doctrine\Common\Persistence\Mapping\ClassMetadata;

use Symfony\Component\Validator\Constraints as Assert;

class Author
{
	/**
	 * @Assert\NotBlank()	 
	 */
	public $name;
	
	public function __construct()
	{
		$this->name = '';
	}
	
	public static function loadValidatorMetadata(ClassMetadata $metadata)
	{
		$metadata->addPropertyContraint('name', new NotBlank());
	} 
}
